<template>
    <div id="chartContainer" style="width: 600px; height: 400px;"></div>
  </template>
  
  <script>
  import * as echarts from 'echarts';
  
  export default {
    name: 'ChartComponent',
    mounted() {
      this.initChart();
    },
    methods: {
      initChart() {
        const chartInstance = echarts.init(document.getElementById('chartContainer'));
        const option = {
          title: {
            text: 'ECharts 示例'
          },
          tooltip: {},
          xAxis: {
            data: ['分类一', '分类二', '分类三', '分类四', '分类五']
          },
          yAxis: {},
          series: [{
            name: '数据系列',
            type: 'bar',
            data: [5, 20, 36, 10, 10]
          }]
        };
        chartInstance.setOption(option);
      }
    }
  };
  </script>
  
  <!-- 可选的样式部分 -->
  <style>
  </style>